﻿#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <vector>

using namespace std;

typedef long long LL;

int main()
{
    int n, k;
    cin >> n >> k;

    vector<int> happy(n, 0);
    vector<int> shame(n, 0);

    for (int i = 0; i < n; ++i)
    {
        cin >> happy[i];
    }

    for (int i = 0; i < n; ++i)
    {
        cin >> shame[i];
    }

    LL left = 0, right = 0, hSum = 0, sSum = 0, hMax = 0, sMin = 0;//使用滑动窗口
    LL result = 0;
    while (right < n)
    {
        hSum += happy[right];
        sSum += shame[right];
        ++right;

        while (right - left > k)//先调整，再判断，不然调整后还没判断，又加了一层循环，加了个数
        {
            hSum -= happy[left];
            sSum -= shame[left];
            ++left;
        }

        if (right - left == k)
        {
            if (hSum > hMax)//有更高的快乐值，更新
            {
                hMax = hSum;
                sMin = sSum;
                result = left + 1;
            }
            else if (hSum == hMax && sSum < sMin)
            {
                hMax = hSum;
                sMin = sSum;
                result = left + 1;
            }
        }
    }

    cout << result << endl;
    return 0;
}

